package com.qinhao.loveCrowdFunding.service;

import com.qinhao.loveCrowdFunding.mapper.UserDataMapper;
import com.qinhao.loveCrowdFunding.pojo.GetTelephoneNumberBO;
import com.qinhao.loveCrowdFunding.pojo.GetTelephoneNumberDTO;
import com.qinhao.loveCrowdFunding.req.GetTelephoneNumberRequest;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

// 用户相关数据管理的服务
@Service
public class UserDataManageService {
    @Autowired
    UserDataMapper userDataMapper;
    public GetTelephoneNumberDTO getTelephoneNumberById(GetTelephoneNumberRequest getTelephoneNumberRequest) {
        GetTelephoneNumberDTO getTelephoneNumberDTO = GetTelephoneNumberDTO.builder().build();
        GetTelephoneNumberBO telephoneNumberById = userDataMapper.getTelephoneNumberById(getTelephoneNumberRequest);
        if (telephoneNumberById != null) {
            BeanUtils.copyProperties(telephoneNumberById, getTelephoneNumberDTO);
        }
        return getTelephoneNumberDTO;
    }
}
